Action hook 'update-custom_{$action}'

in WP Core File wp-admin/update.php at line 370

View Source

update-custom_{$action}

Action Hook
Description
Fires when a custom plugin or theme update request is received. The dynamic portion of the hook name, `$action`, refers to the action provided in the request for wp-admin/update.php. Can be used to provide custom update functionality for themes and plugins.

Hook Information

File Location wp-admin/update.php View on GitHub
Hook Type Action
Line Number 370

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into update-custom_{$action}
add_action('update-custom_{$action}', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-admin/update.php:370 - How this hook is used in WordPress core
<?php
 365  		 * provided in the request for wp-admin/update.php. Can be used to
 366  		 * provide custom update functionality for themes and plugins.
 367  		 *
 368  		 * @since 2.8.0
 369  		 */
 370  		do_action( "update-custom_{$action}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
 371  	}
 372  }

PHP Documentation

<?php
/**
		 * Fires when a custom plugin or theme update request is received.
		 *
		 * The dynamic portion of the hook name, `$action`, refers to the action
		 * provided in the request for wp-admin/update.php. Can be used to
		 * provide custom update functionality for themes and plugins.
		 *
		 * @since 2.8.0
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-admin/update.php
Related Hooks

Related hooks will be displayed here in future updates.